// 之前用若依生成代码的时候未考虑清楚表名、业务名的关系；之后需保持一致。

fun busiNameMap(): Map<String, String> {
    return mapOf(
        "task" to "OrderTask",
        "product" to "Product",
        "process" to "ProductProcess",
        "order" to "Order",
        "groupDetail" to "BaseWorkGroupDetail",
        "group" to "BaseWorkGroup",
        "detail" to "ProductProcessDetail",
        "criminal" to "BaseCriminal"
    )
}


fun controllerMethod(m: Map<String, String>): String {
    if (m["type"] == "get") {
        var comment = m["comment"]?: ""
        var type = m["type"]
        var name = m["name"]
        var param = m["param"]?: ""
        return """
        /**
        * $comment
        */
        @PreAuthorize("@ss.hasPermi('xxx:xxx:list')")
        @GetMapping("/$name")
        public AjaxResult $name(${param.capitalize()} $param) {
            log.debug("进入controller的{}方法，参数是{}","$name",$param);
            // TODO busi code
            return success();
        }
"""
    } else {
        return """
    /**
    * %s
    */
    @PreAuthorize("@ss.hasPermi('xxx:xxx:edit')")
    @Log(title = "xxx", businessType = BusinessType.UPDATE)
    @PostMapping("/%s")
    public AjaxResult %s(@RequestBody %s %s)
    {
    	log.debug("进入controller的%s方法，参数是{}",%s);
        // TODO busi code
        return toAjax();
    }
"""
    }
}






